Component({
    properties: {
        currentPath: {
            type: String,
            value: ''
        }
    },
    data: {
        list: [
            {
                iconPath: "/image/home.png",
                selectedIconPath: "/image/home_active.png",
                pagePath: "/pages/index/index",
                text: "首页"
            },
            {
                iconPath: "/image/coach.png",
                selectedIconPath: "/image/coach_active.png",
                pagePath: "/pages/coach/index",
                text: "名师教练"
            },
            {
                iconPath: "/image/user.png",
                selectedIconPath: "/image/user_active.png",
                pagePath: "/pages/user/index",
                text: "我的"
            }]

    },
    methods: {
        switchTab(e) {
            const data = e.currentTarget.dataset;
            const url = data.path;
            // console.log(url)
            tt.switchTab({ url });
        }
    },
    lifetimes: {
        attached() {
            this.setData({
                currentPath: '/' + getCurrentPages().pop().route
            });
        }
    }
});